trigger UserEmailChange on User (after update) {
	Map<Id, User> newUsers = new Map<Id, User>(trigger.new);
	Map<Id, User> oldUsers = new Map<Id, User>(trigger.old);
	Map<Id, User> changedUsers = new Map<Id, User>();
	
	for (Id key : newUsers.keySet()) {
		User newUser = newUsers.get(key);
		User oldUser = oldUsers.get(key);
		if (newUser.email != oldUser.email) {
			changedUsers.put(newUser.Id, newUser);
		}
	}
	
	List<MeetingInvitees__c> inv = [Select Id, Email__c From MeetingInvitees__c Where User__c in :changedUsers.keySet()];
	for (MeetingInvitees__c mi : inv) {
		mi.Email__c = changedUsers.get(mi.User__c).Email;
	}
	
	List<MeetingAttendees__c> att = [Select Id, Email__c From MeetingAttendees__c Where User__c in :changedUsers.keySet()];
	for (MeetingAttendees__c ma : att) {
		ma.Email__c = changedUsers.get(ma.User__c).Email;
	}
	
	update inv;
	update att;

}